<template>
  <div class="wrapper">
    <swiper :options="swiperOption" ref="mySwiper" @someSwiperEvent="callback">
      <!-- slides -->
      <swiper-slide  v-for="item of swiperList" :key="item.id">
        <img class="swiper-img" :src="item.imgUrl">
      </swiper-slide>

      <!-- Optional controls -->
      <div class="swiper-pagination"  slot="pagination"></div>
    </swiper>
  </div>
</template>

<script>
export default {
  name: 'HomeSwiper',
  data () {
    return {
      swiperOption: {
        pagination: '.swiper-pagination',
        loop: true
      },
      swiperList: [{
        id: '01',
        imgUrl: 'http://p1.music.126.net/M9FGHt-R_XJ7gAm_KcSV5Q==/109951163582626790.jpg'
      }, {
        id: '02',
        imgUrl: 'http://p1.music.126.net/YCVevsPlCfjLVNa92kKd2w==/109951163586830851.jpg'
      }, {
        id: '03',
        imgUrl: 'http://p1.music.126.net/v1IWAVsbrFJlC0LCf1vw1w==/109951163585571913.jpg'
      }, {
        id: '04',
        imgUrl: 'http://p1.music.126.net/lJa_EVB09AWlxUXg369-OQ==/109951163587138059.jpg'
      }]
    }
  }
}
</script>

<style lang="stylus" scoped>
  .wrapper >>> .swiper-pagination-bullet-active
    background: #fff
  .wrapper
    overflow: hidden
    width: 100%
    height: 0
    padding-bottom: 46%
    background: #ccc
    .swiper-img
      width: 100%
</style>
